package SmartFurniture.Factory.Huawei;

import SmartFurniture.AbstractBuilder.SpeakerBuilder;
import SmartFurniture.AbstractFactory.AirConditioner;
import SmartFurniture.AbstractFactory.Light;
import SmartFurniture.Director.SpeakerDirector;
import SmartFurniture.Entity.Speaker;
import SmartFurniture.Interface.AbstractFactory;


//工厂模式
public class HuaweiDevice implements AbstractFactory {
    @Override
    public AirConditioner createAirConditioner() {
        return new HuaweiAirConditioner();
    }

    @Override
    public Light createLight() {
        return new HuaweiLight();
    }

    @Override
    public Speaker createSpeaker() {
        SpeakerBuilder speakerBuilder = new HuaweiSpeakerBuilder();
        SpeakerDirector speakerDirector = new SpeakerDirector(speakerBuilder);
        return speakerDirector.constructSpeaker();
    }
}
